<?php /* Smarty version 2.6.26, created on 2018-07-25 14:30:59
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/member%5Ctemplates/collect/index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'import', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/collect/index.html', 1, false),array('function', 'uqcms', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/collect/index.html', 20, false),array('modifier', 'img_size', 'E:\\WWW\\40.125.208.171\\vweb/member\\templates/collect/index.html', 25, false),)), $this); ?>
<?php echo $this->_plugins['function']['import'][0][0]->import(array('file' => "index/header.html",'title' => "商品收藏"), $this);?>
  
<style type="text/css">
.lbox{ padding-top:30px; float:left;}
.lcon{ width:1030px; float:left; }
.cgbox{ width:215px; height:215px; position: relative; border:1px solid #efefef; padding:25px 10px; margin:0 10px 15px 10px; float:left;}
.cgbox:hover{ border:1px solid #ddd; }
.cgbox .img{ width:215px; height:160px; text-align:center; overflow:hidden; float:left; }
.cgbox .img img{ width:160px;}
.cgbox .ttl{ width:200px; height:20px; overflow:hidden; padding:10px 10px 0 10px; float:left;}
.cgbox .ttl a{ line-height:20px; color:#333; }
.cgbox .pr{ width:205px; padding:5px 0 0 5px; text-align:center; float:left;}
.cgbox .pr span{ padding:0 10px 0 0; color:#f00; font-family: Verdana; font-size:16px; }
.cgbox .pr s{ margin-top:3px; color:#999; float:left; }
.cgbox .cancel{ width:236px; display:none; position:absolute; top:0; right:0; padding:0 0 0 5px; float:left;}
.cgbox .cancel a{ padding:2px 12px; background:#666; border:1px solid #666; color:#fff; float:right; } 
.cgbox:hover .cancel{ display:block; }
</style> 
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "collect/tab.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<div class="lbox">
	<?php echo $this->_plugins['function']['uqcms'][0][0]->load_module(array('m' => 'goods','v' => 'data','c' => "collect:page=smarty.get.page&page_size=32"), $this);?>

	<?php if ($this->_tpl_vars['data']['list']): ?>
		<div class="lcon"> 
			<?php $_from = $this->_tpl_vars['data']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>	
				<div class="cgbox">
					<div class="img"><a href="index.php?m=goods&a=detail&id=<?php echo $this->_tpl_vars['i']['gid']; ?>
" target="_blank"><img src="<?php echo $this->_tpl_vars['__IMG__']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['images'])) ? $this->_run_mod_handler('img_size', true, $_tmp, '160x160') : $this->_plugins['modifier']['img_size'][0][0]->img_size($_tmp, '160x160')); ?>
"></a></div>
					<div class="ttl"><a href="index.php?m=goods&a=detail&id=<?php echo $this->_tpl_vars['i']['gid']; ?>
" target="_blank"><?php echo $this->_tpl_vars['i']['title']; ?>
</a></div>
					<div class="pr"><span>￥<?php echo $this->_tpl_vars['i']['price']; ?>
</span></div>
					<div class="cancel"><a href="javascript:;" class="collect_goods" data-gid="<?php echo $this->_tpl_vars['i']['gid']; ?>
">取消收藏</a></div> 
				</div>
			<?php endforeach; endif; unset($_from); ?>
		</div>
		<?php if ($this->_tpl_vars['data']['page']): ?><div class="page" style="text-align:center;"><?php echo $this->_tpl_vars['data']['page']; ?>
</div><?php endif; ?>
	<?php else: ?>	
		<div class="bfb">
			<div class="nomsg"><i></i><span>您还没有收藏产品~</span></div>
		</div>
	<?php endif; ?>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript">
$(function(){ 
	$(".collect_goods").click(function(){
		$this = $(this);
		gid = $this.attr('data-gid');
		$.post("index.php?m=ajax&a=collect_goods",{gid:gid},function(result){  
			var data = jQuery.parseJSON(result);  
			if(data.error == '0'){
				if(data.status == '2'){ 
					location.reload();
				}else if(data.status == '1'){ 
					$this.html('已经收藏');
				}else if(data.status == '0'){
					$this.html('收藏产品');
				}
			}else{
				alert(data.msg);
			} 
		}); 
	}); 
});
</script>